package com.easepal802s.project.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.easepal802s.project.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by FHB on 2018/4/24.
 */
public class LayoutGears5 extends RelativeLayout {
    private List<ImageView> mIvLists = new ArrayList<>();
    public LayoutGears5(Context context) {
        super(context);
    }

    public LayoutGears5(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        mIvLists.clear();
        mIvLists.add((ImageView) findViewById(R.id.iv_gears5_0));
        mIvLists.add((ImageView) findViewById(R.id.iv_gears5_1));
        mIvLists.add((ImageView) findViewById(R.id.iv_gears5_2));
        mIvLists.add((ImageView) findViewById(R.id.iv_gears5_3));
        mIvLists.add((ImageView) findViewById(R.id.iv_gears5_4));
        mIvLists.add((ImageView) findViewById(R.id.iv_gears5_5));
    }
    public void setShow(int position){
        for(int i =0;i<mIvLists.size();i++){
            if(i==position){
                mIvLists.get(i).setVisibility(VISIBLE);
            }
            else {
                mIvLists.get(i).setVisibility(GONE);
            }
        }
    }
}
